﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using TransFormer.BLL;

namespace TransFormer.Web
{
    public partial class NewsDetial : System.Web.UI.Page
    {
        private readonly BLL.Article _bll = new Article();
        public Model.Article NewsInfo { get; set; }

        private BLL.KeyWords _bllKey = new TransFormer.BLL.KeyWords();
        protected void Page_Load(object sender, EventArgs e)
        {
            var model2 = _bllKey.GetModel(4);
            if (model2 != null)
            {
                HtmlMeta keywords = new HtmlMeta();
                keywords.Name = "keywords";
                keywords.Content = model2.KeyContent;
                Page.Header.Controls.Add(keywords);
                HtmlMeta desc = new HtmlMeta();
                desc.Name = "description";
                desc.Content = model2.PageDesc;
                Page.Header.Controls.Add(desc);
                Title = model2.Title;

            }
            int id;
            if (!int.TryParse(Request["NewsId"], out id)) return;
            NewsInfo = _bll.GetModel(id);

        }
    }
}